#include "Component.h"
#include "Composite.h"

using namespace std;

int main(int argc, char *argv[])
{
    Component *tree    = new Composite();
    Component *branch1 = new Composite();
    Component *branch2 = new Composite();

    Component *leaf1 = new Leaf("leaf1");
    Component *leaf2 = new Leaf("leaf2");
    Component *leaf3 = new Leaf("leaf3");

    branch1->add(leaf1);
    branch1->add(leaf2);
    branch2->add(leaf3);

    tree->add(branch1);
    tree->add(branch2);

    tree->operation();
    return 0;
}